#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'r1.fq [r2.fq]'
exit 2
}

while getopts  ":p:f:t:" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
		f) suffix=$OPTARG;;
		t) threads=$OPTARG;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))

if [ $# -lt 1 ]; then info; fi

. $var

len1=6
# --stringency 3 overlapping
# --length 30 minimum length
# --no_report_file
# --clip_R1 <int> Instructs Trim Galore to remove <int> bp from the 5' end of read 1 (or single-end reads).
# --three_prime_clip_R1 <int>     Instructs Trim Galore to remove <int> bp from the 3' end of read 1 (or single-end  reads) AFTER adapter/quality trimming has been performed. This may remove some unwanted bias from the 3' end that is not directly related to adapter sequence or basecall quality.
# --non_directional       Selecting this option for non-directional RRBS libraries will screen
                        # quality-trimmed sequences for 'CAA' or 'CGA' at the start of the read
                        # and, if found, removes the first two basepairs. Like with the option
                        # '--rrbs' this avoids using cytosine positions that were filled-in
                        # during the end-repair step. '--non_directional' requires '--rrbs' to
                        # be specified as well.

trim_galore --dont_gzip --length 30 --stringency 3 -clip_r1 $len1 -clip_r2 $len1 -paired $1 $2

. $cmd_done